package com.jsu.clubmanagementsystem.service.application;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jsu.clubmanagementsystem.common.PageQueryRequest;
import com.jsu.clubmanagementsystem.model.dto.userapplication.UserApplicationAddRequest;
import com.jsu.clubmanagementsystem.model.dto.userapplication.UserApplicationQueryRequest;
import com.jsu.clubmanagementsystem.model.entity.UserApplication;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jsu.clubmanagementsystem.model.vo.userApplication.UserApplicationVO;

import java.util.List;

/**
* @author 24753
* @description 针对表【user_application(用户相关申请)】的数据库操作Service
* @createDate 2025-05-17 17:05:45
*/
public interface UserApplicationService extends IService<UserApplication> {

    /**
     * 处理申请
     * @param addRequest
     * @return
     */
    Long processApplication(UserApplicationAddRequest addRequest);

    /**
     * 获取封装对象
     *
     * @param application
     * @return
     */
    UserApplicationVO getUserApplicationVO(UserApplication application);

    /**
     * 查看申请列表 (分页)
     *
     * @param queryRequest
     * @return
     */
    Page<UserApplicationVO> listApplicationVOForUserByPage(UserApplicationQueryRequest queryRequest);

    /**
     * 查看申请列表 (分页、社长)
     *
     * @param queryRequest
     * @return
     */
    Page<UserApplicationVO> listApplicationVOForManagerByPage(UserApplicationQueryRequest queryRequest, Long clubId);

    /**
     * 查看申请列表 (分页、管理员)
     *
     * @param queryRequest
     * @return
     */
    Page<UserApplicationVO> listApplicationVOForAdminByPage(UserApplicationQueryRequest queryRequest);

    /**
     * 申请是否存在
     *
     * @param applicationId
     * @return
     */
    boolean isExist(Long applicationId);

    /**
     * 申请是否存在
     * @param applicationId
     * @param type
     * @return
     */
    boolean isExist(Long applicationId, Integer type);

    /**
     * 申请是否存在
     * @param application 申请对象
     * @return 是否存在
     */
    boolean isExist(UserApplication application);

    /**
     * 集合中的申请是否都审核完成
     * @param applicationList
     * @return
     */
    boolean isApplicationsAllReview(List<UserApplication> applicationList);

    /**
     * 获取查询封装
     *
     * @param queryRequest
     * @return
     */
    QueryWrapper<UserApplication> getQueryWrapper(UserApplicationQueryRequest queryRequest);

    /**
     * 获取社团收到的申请列表
     * @param clubId
     * @return
     */
    List<UserApplication> getAllApplicationsOfClub(Long clubId);

    Page<UserApplication> getAllUserApplications(PageQueryRequest page);

    void deleteUserApplications(List<Long> ids);
}
